import request from '@/utils/request'

const api = {
    tree: '/menu/tree',
    addMenu: '/menu/add',
    menuList: '/menu/list',
    editMenu: '/menu/edit',
    removeMenu: '/menu/remove'
  }

  export function getTree (parameter) {
    return request({
      url: api.tree,
      method: 'post',
      data: parameter
    })
  }

  export function addMenu (parameter) {
    return request({
      url: api.addMenu,
      method: 'post',
      data: parameter
    })
  }

  export function menuList (parameter) {
    return request({
      url: api.menuList,
      method: 'post',
      data: parameter
    })
  }

  export function editMenu (parameter) {
    return request({
      url: api.editMenu,
      method: 'post',
      data: parameter
    })
  }

  export function removeMenu (parameter) {
    return request({
      url: api.removeMenu,
      method: 'post',
      data: parameter
    })
  }
